package org.ehe.finance.receipt.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.ehe.finance.receipt.domain.ErpFinanceReceiptDetail;

import java.util.List;

/**
 * 收款单明细Mapper接口
 * @author :zhangnn
 * @className :ReceiptDetailMapper
 * @description: TODO
 * @date 2025-09-02 14:26:32
 */
@Mapper
public interface ReceiptDetailMapper extends BaseMapper<ErpFinanceReceiptDetail> {
    /**
     * 根据收款单ID查询明细
     * @param receiptId 收款单ID
     * @return 收款明细列表
     */
    List<ErpFinanceReceiptDetail> selectDetailByReceiptId(@Param("receiptId") Long receiptId);

    /**
     * 批量插入收款明细
     * @param detailList 明细列表
     * @return 影响行数
     */
    int batchInsertDetails(@Param("list") List<ErpFinanceReceiptDetail> detailList);

    /**
     * 根据收款单ID删除明细
     * @param receiptId 收款单ID
     * @return 影响行数
     */
    int deleteByReceiptId(@Param("receiptId") Long receiptId);

    /**
     * 批量根据收款单ID删除明细
     * @param receiptIds 收款单ID列表
     * @return 影响行数
     */
    int batchDeleteByReceiptIds(@Param("receiptIds") List<Long> receiptIds);
}
